package com.shuiyu.cloud.controller;

import com.shuiyu.cloud.entities.CommonResult;
import com.shuiyu.cloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author rjw
 * <p>Description:   </p>
 * @ClassName OrderFeignController
 * @time 2021/7/16 15:00
 */
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentFeignService feignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult aaa(@PathVariable("id") Long id){
        return feignService.query(id);
    }

    @GetMapping("/payment/feignTimeout")
    public  String paymentFeignTimeout(){
        //openFeign,客户端默认等待1秒钟
        return feignService.paymentFeignTimeout();

    }
}
